$(document).ready(
	function() {
	
		$('ol.sortable').nestedSortable({
			forcePlaceholderSize: true,
			handle: 'div',
			helper: 'clone',
			items: 'li',
			maxLevels: 5,
			opacity: .6,
			placeholder: 'placeholder',
			revert: 250,
			tabSize: 25,
			tolerance: 'pointer',
			toleranceElement: '> div'
		});
		
		$('#menu_order_save_order').click(function(e){
			hiered = $('ol.sortable').nestedSortable('toHierarchy');
			
			$.post('/admin/menu_order_ajax/save_menu_order', {'hiered' : hiered}, function(data){
				
			}, 'json');
		});
	}
);